package com.workcell.workdata.xthings.entity.mqtt;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.workcell.workdata.xthings.constant.ExtOutputAttributes;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @Author 廖博文
 * @Date 2022/11/18 15:07
 * @Description 流量计数据
 */
@Data
@TableName("t_flowmeter_data")
public class FlowMeterData extends Model<FlowMeterData> {

    /**
     * 流量计数据ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    private String fmId;
	/** 厂商编码 */
	private String manufacturerCode;
    /**
     * 数据采集时间
     */
	@ExtOutputAttributes(key = "数据采集时间")
    @TableField(value = "`CURRENT_TIME`")
    private LocalDateTime currentTime;
    /**
     * 设备编号
     */
	@ExtOutputAttributes(key = "设备编号")
    private String deviceNo;
    /**
     * 瞬时流量
     */
	@ExtOutputAttributes(key = "瞬时流量")
    private String flowRate;
    /**
     * 累计流量
     */
	@ExtOutputAttributes(key = "累计流量")
    private String cumFlow;
    /**
     * 正累计流量
     */
    private String posCumFlow;
    /**
     * 负累计流量
     */
    private String negaCumFlow;
    /**
     * 数据入库时间
     */
    private LocalDateTime createDate;
	/**
	 * 流量异常
	 */
	@ExtOutputAttributes(key = "流量异常")
	private String unusualStatus;
	/**
	 * 最近1小时流量
	 */
	@TableField(exist = false)
	@ExtOutputAttributes(key = "最近1小时流量")
	private String cumFlowDiffDataHour;
	/**
	 * 最近24小时流量
	 */
	@TableField(exist = false)
	@ExtOutputAttributes(key = "最近24小时流量")
	private String cumFlowDiffDataDay;
	/**
	 * 最近30天流量
	 */
	@TableField(exist = false)
	@ExtOutputAttributes(key = "最近30天流量")
	private String cumFlowDiffDataMonth;
	/**
	 * 本月累计流量
	 */
	@TableField(exist = false)
	@ExtOutputAttributes(key = "本月累计流量")
	private String cumFlowDiffDataSameMonth;


}
